#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
    int m = 5, n = 6;
    int(*p)[m];
    p = (int(*)[m])malloc(m * n * sizeof(int));
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            *(*(p + j) + n) = i * j;
        }
    }
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            printf("%d,", *(*(p + j) + n));
        }
    }
    free(p);
}